package day10;

public class Circle extends Shape {
 // 半径
 private int r;

 // 构造器
 public Circle() {
 }

 public Circle(String name, int r) {
   super(name);
   this.r = r;
 }

 // 继承了有抽象方法的父类，子类必须重写父类中所有的抽象方法
 @Override
 public double getArea() {
   return Math.PI * r * r;
 }
}
